Skip to content

Synchronize PAL lifecycle generations - #1564

Open
bmehta001 wants to merge 1 commit into
microsoft:mainfrom
bmehta001:recover-pal-generation
Open

bmehta001 wants to merge 1 commit into
microsoft:mainfrom
bmehta001:recover-pal-generation

Conversation

@bmehta001

Copy link
Copy Markdown
Contributor

Summary

  • Synchronize PAL initialization, reference counts, dispatcher/provider publication, and semantic-context snapshots without holding the state lock during provider construction or destruction.
  • Roll back failed initialization and associate the global debug log with its owning generation, so an older shutdown cannot close a newer stream.
  • Add concurrency, rollback, dispatcher, logging-generation, and disabled-feature regression coverage.

Validation

  • Windows, Visual Studio 2026: UnitTests.exe --gtest_filter=PalTests.*:LogInitTest.* — 37 passed.
  • WSL Ubuntu 24.04, GCC 13: ./UnitTests --gtest_filter=PalTests.*:LogInitTest.* — 35 passed.
  • Windows, local HTTP server: FuncTests.exe --gtest_filter=BasicFuncTests.doNothing:BasicFuncTests.sendOneEvent_immediatelyStop:BasicFuncTests.teardownDuringInFlightUpload_ShutsDownCleanly:BasicFuncTests.configDecorations — 4 passed.
  • Windows: cmake --build out\vs2026-noexcept-smoke --config Debug --target no-exceptions-smoke --parallel 8 and ctest --test-dir out\vs2026-noexcept-smoke -C Debug --output-on-failure — passed with exceptions, logging, and native device ID disabled.
  • WSL: cmake --build out/linux-noexcept-smoke --target no-exceptions-smoke --parallel 8 and ctest --test-dir out/linux-noexcept-smoke --output-on-failure — passed with the same three features disabled.
  • Android arm64: cmake --build out\android-arm64 --target mat --parallel 8 — passed; no Android runtime/device test was available.
  • git diff --check HEAD~1 HEAD — passed. Optional git clang-format --diff HEAD~1 reports formatting differences; it was not applied because it rewrites surrounding namespace macros/indentation, and the repository documents clang-format as optional.

The Google Test filters excluded unrelated suites; no disabled tests were listed in the selected PAL/logging suites. Optional lib/modules sources were not present in these builds.

Publish complete PAL generations atomically so concurrent initialization and shutdown cannot race provider ownership or close a newer logging stream. Release providers outside the state lock and roll back failed initialization.

Files: lib/pal/PAL.cpp, lib/pal/PAL.hpp, tests/functests/BasicFuncTests.cpp, tests/no-exceptions/no-exceptions-smoke.cpp, tests/unittests/PalTests.cpp

Co-authored-by: Copilot <[email protected]>
Copilot-Session: f7e2f450-c2c4-43c5-9fb1-05fa4f7d8e9e
@bmehta001
bmehta001 requested a review from a team as a code owner November 19, 2026 18:21
@bmehta001
bmehta001 enabled auto-merge (squash) November 19, 2026 18:21
@bmehta001

Copy link
Copy Markdown
Contributor Author

CI note: the Ubuntu runner-contract and GCC/Clang public-header failures also occur on unchanged main (c7761eb4; https://github.com/microsoft/cpp_client_telemetry/actions/runs/44442208907). The macOS runner-contract sibling was cancelled. Existing PR #1562 fixes both baseline issues, and its corresponding checks pass. Neither failed job is a required branch-protection context.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant